package oop6;

public class Student {
	private String name;
	private int age;

	static {
		System.out.println("从孔子开始有学生");
	}

	// 匿名构造块，在所有的构造方法前执行
	{
		System.out.println("有对象产生。。。。" + this);
	}

	public Student() {

	}

	public Student(String name) {
		super();
		this.name = name;
	}

	public Student(int age) {
		super();
		this.age = age;
	}

	public Student(String name, int age) {
		super();
		this.name = name;
		this.age = age;
	}

	@Override
	public String toString() {
		return "Student [name=" + name + ", age=" + age + "]";
	}

}
